WPP:RegisterAction("USE", "Use", "Press the 'use key' on an entity.");

WPP:SetWorldAcess(WPP_USE, function(Player)
	local Int = GetConVarNumber("wpp_allow_use_on_world");
	
	if ( Int == 1 ) then
		return true
	end
	
	if ( Int == 2 ) and ( Player:IsAdmin() ) then
		return true;
	end
	
	if ( Int >= 3 ) and ( Player:IsSuperAdmin() ) then
		return true;
	end
	
	return false;
end);

function WPP.CanUse(Player,Entity)
	if ( !WPP:IsValid(Entity) ) then
		return false;
	end
	
	return WPP:ValidateAction(WPP_USE,Entity,Player)
end

hook.Add("PlayerUse","WPP-PlayerUse",WPP.CanUse)